<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: doublelinkedlist.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">doublelinkedlist.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include&lt;iostream&gt;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> DT&gt;</div>
<div class="line"><a name="l00006"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html">    6</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;{</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;    <span class="keyword">struct </span>Node</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;        DT data;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;        Node *prev;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        Node *next;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        Node( <span class="keyword">const</span> DT &amp; d = DT{ }, Node* p = <span class="keyword">nullptr</span>, Node* n = <span class="keyword">nullptr</span>)</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        :data{ d }, prev{ p } , next{ n } { }</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        Node( DT &amp;&amp; d, Node * p = <span class="keyword">nullptr</span>, Node * n = <span class="keyword">nullptr</span> )</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        : data{ std::move( d ) }, prev{ p }, next{ n } { }</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    };</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html">   36</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    {</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a112ee57553bfe22c9a26c21267bfd226">   41</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a112ee57553bfe22c9a26c21267bfd226">const_iterator</a>( ) : <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>{ nullptr }{ }</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a3402baf1083aa613ca04732e7d783179">   45</a></span>&#160;            <span class="keyword">const</span> DT &amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a3402baf1083aa613ca04732e7d783179">operator* </a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">            </span>{ <span class="keywordflow">return</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">retrieve</a>( ); }</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a4f6c7762f7932f1abcd6286b9c8360e1">   50</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a4f6c7762f7932f1abcd6286b9c8360e1">operator++ </a>( )</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a> = <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>-&gt;next;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            }</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#afca1bfe511f583eacd69dd965ce129c5">   59</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a4f6c7762f7932f1abcd6286b9c8360e1">operator++ </a>( <span class="keywordtype">int</span> )</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            {</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> old = *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;            ++( *this );<span class="comment">//调用了上一个重载函数;</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            <span class="keywordflow">return</span> old;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;            }</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#ad93b067ec784301698d9890c721d3668">   68</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ad93b067ec784301698d9890c721d3668">operator-- </a>( )</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            {</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a> = <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>-&gt;prev;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            }</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#acfca335a1870bcccdb3f656b95ed1fad">   77</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ad93b067ec784301698d9890c721d3668">operator-- </a>( <span class="keywordtype">int</span> )</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            {</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> old = *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            --( *this );<span class="comment">//调用了上一个重载函数;</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            <span class="keywordflow">return</span> old;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            }</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a512b2d20b89afad27ab692e8ea1134d4">   87</a></span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a512b2d20b89afad27ab692e8ea1134d4">operator== </a>( <span class="keyword">const</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; rhs )<span class="keyword"> const</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="keyword">            </span>{ <span class="keywordflow">return</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a> == rhs.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>; }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a2446ddd53bbc08c8b2fcc333db23ccb4">   93</a></span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a2446ddd53bbc08c8b2fcc333db23ccb4">operator!= </a>( <span class="keyword">const</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; rhs )<span class="keyword"> const</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="keyword">            </span>{ <span class="keywordflow">return</span> !( *<span class="keyword">this</span> == rhs ); }<span class="comment">//调用了上一个重载函数;</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">   98</a></span>&#160;            Node *<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">  102</a></span>&#160;            DT &amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">retrieve</a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="keyword">            </span>{ <span class="keywordflow">return</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>-&gt;data; }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a32e0bd5fcc6b2379ab6ffceb154a3058">  107</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a32e0bd5fcc6b2379ab6ffceb154a3058">const_iterator</a>( Node *p ) : <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>{ p }{ }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&lt;DT&gt;;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    };</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html">  114</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a>: <span class="keyword">public</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a></div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    {</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#a9b2f090babb672b094aa4bd290238d80">  118</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html#a9b2f090babb672b094aa4bd290238d80">iterator</a>( ) { }</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#ae6cb0eac7eeb7bc0fbd4b6dcf5616e50">  122</a></span>&#160;            DT &amp; <a class="code" href="classDoubleLinkedList_1_1iterator.html#ae6cb0eac7eeb7bc0fbd4b6dcf5616e50">operator* </a>( )</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            { <span class="keywordflow">return</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">const_iterator::retrieve</a>( ); }</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#adc6bd0eb3863aa794989fea08a7b4247">  127</a></span>&#160;            <span class="keyword">const</span> DT &amp; <a class="code" href="classDoubleLinkedList_1_1iterator.html#ae6cb0eac7eeb7bc0fbd4b6dcf5616e50">operator* </a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="keyword">            </span>{ <span class="keywordflow">return</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a3402baf1083aa613ca04732e7d783179">const_iterator::operator*</a>( ); }</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#a18bcade792226cb8c59e90c5be0875f8">  132</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> &amp; <a class="code" href="classDoubleLinkedList_1_1iterator.html#a18bcade792226cb8c59e90c5be0875f8">operator++ </a>( )</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;            {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                this-&gt;<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a> = this-&gt;<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>-&gt;next;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;            }</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;            </div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#a4c7b251313ae3932fdb7f7781a5ab1c3">  141</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList_1_1iterator.html#a18bcade792226cb8c59e90c5be0875f8">operator++ </a>( <span class="keywordtype">int</span> )</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> old = *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                ++( *this );</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                <span class="keywordflow">return</span> old;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            }</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#a6e599dab684490c6339740d7a5cb8ae8">  150</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> &amp; <a class="code" href="classDoubleLinkedList_1_1iterator.html#a6e599dab684490c6339740d7a5cb8ae8">operator-- </a>( )</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;            {</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;                this-&gt;<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a> = this-&gt;<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>-&gt;prev;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;            }</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#a021d15fd698457d5c9cb74d26e017816">  159</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList_1_1iterator.html#a6e599dab684490c6339740d7a5cb8ae8">operator-- </a>( <span class="keywordtype">int</span> )</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;            {</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> old = *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;                --( *this );</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;                <span class="keywordflow">return</span> old;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;            }</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        </div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#acd436ad14dcf75e42eec3f1544e934f3">  169</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html#a9b2f090babb672b094aa4bd290238d80">iterator</a>( Node *p ) : <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a>{ p } { }</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&lt;DT&gt;;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    };</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#aee88179cbec704a72abc4ffedaaae206">  177</a></span>&#160;    <a class="code" href="classDoubleLinkedList.html#aee88179cbec704a72abc4ffedaaae206">DoubleLinkedList</a>( )</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    {</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;      init( );</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    }</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a9f6fd6fab778f30041aa6119b67d70db">  184</a></span>&#160;    <a class="code" href="classDoubleLinkedList.html#a9f6fd6fab778f30041aa6119b67d70db">DoubleLinkedList</a>( <span class="keyword">const</span> <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp; rhs )</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    {</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        init( );</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        <span class="keywordflow">for</span>( <span class="keyword">auto</span> &amp; x : rhs )</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        <a class="code" href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">push_back</a>( x );</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    }</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a941489c5c72cb46a00e24ff1c998b087">  193</a></span>&#160;    <a class="code" href="classDoubleLinkedList.html#a941489c5c72cb46a00e24ff1c998b087">~DoubleLinkedList</a>( )</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    {</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        <a class="code" href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">clear</a>( );</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keyword">delete</span> head;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <span class="keyword">delete</span> tail;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    }</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a857b3efd79c7794a99b82bbe65d4f2a9">  203</a></span>&#160;    <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp; <a class="code" href="classDoubleLinkedList.html#a857b3efd79c7794a99b82bbe65d4f2a9">operator= </a>( <span class="keyword">const</span> <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp; rhs )</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    {</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;        <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> copy = rhs;</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        std::swap( *<span class="keyword">this</span>, copy );<span class="comment">//swap函数交换地址;</span></div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    }</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    </div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160; </div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a1a2a7c993e056a3d7e15bd1bf3d38bf2">  213</a></span>&#160;    <a class="code" href="classDoubleLinkedList.html#a1a2a7c993e056a3d7e15bd1bf3d38bf2">DoubleLinkedList</a>( <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp;&amp; rhs )</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;        : theSize{ rhs.theSize }, head{ rhs.head }, tail{ rhs.tail }</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    {</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        rhs.theSize = 0;</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;        rhs.head = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        rhs.tail = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    }</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    </div>
<div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a134e16aa90f251ec1fe732b8b83a758d">  224</a></span>&#160;    <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp; <a class="code" href="classDoubleLinkedList.html#a857b3efd79c7794a99b82bbe65d4f2a9">operator= </a>( <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp;&amp; rhs )</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    {</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        std::swap( theSize, rhs.theSize );</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        std::swap( head, rhs.head );</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        std::swap( tail, rhs.tail );</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    }</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    </div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">  235</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>( )</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    { <span class="keywordflow">return</span> { head-&gt;next }; }</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#abb15c59c5b15dbdecae44e186e7c9b2d">  240</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classDoubleLinkedList.html#abb15c59c5b15dbdecae44e186e7c9b2d">begin</a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> { head-&gt;next }; }</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160; </div>
<div class="line"><a name="l00245"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">  245</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>( )</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    { <span class="keywordflow">return</span> { tail }; }</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    </div>
<div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a683ec24475d58d896c47b00d9893fb6d">  250</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classDoubleLinkedList.html#a683ec24475d58d896c47b00d9893fb6d">end</a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> { tail }; }</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160; </div>
<div class="line"><a name="l00255"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">  255</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">size</a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> theSize; }</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    </div>
<div class="line"><a name="l00260"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">  260</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">empty</a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> <a class="code" href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">size</a>( ) == 0; }</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160; </div>
<div class="line"><a name="l00264"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">  264</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">clear</a>( )</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    {</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;        <span class="keywordflow">while</span>( !<a class="code" href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">empty</a>( ) )</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        <a class="code" href="classDoubleLinkedList.html#a8526d84e8c9d45422e591056d64dd013">pop_front</a>( );</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    }</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    </div>
<div class="line"><a name="l00272"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a321d39c83c64c5a56491cfb6312c3112">  272</a></span>&#160;    DT &amp; <a class="code" href="classDoubleLinkedList.html#a321d39c83c64c5a56491cfb6312c3112">front</a>( )</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    { <span class="keywordflow">return</span> *<a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>( ); }</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160; </div>
<div class="line"><a name="l00277"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a783cd5151e28aa5396fa7ea79f64835b">  277</a></span>&#160;    <span class="keyword">const</span> DT &amp; <a class="code" href="classDoubleLinkedList.html#a783cd5151e28aa5396fa7ea79f64835b">front</a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> *<a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>( ); }</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a7203970b5e6ab0dadfdc039bc5714dca">  282</a></span>&#160;    DT &amp; <a class="code" href="classDoubleLinkedList.html#a7203970b5e6ab0dadfdc039bc5714dca">back</a>( )</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    { <span class="keywordflow">return</span> *--<a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>( ); }</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160; </div>
<div class="line"><a name="l00287"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#ae4df7660c6cb44e3176de9e748a8f755">  287</a></span>&#160;    <span class="keyword">const</span> DT &amp; <a class="code" href="classDoubleLinkedList.html#ae4df7660c6cb44e3176de9e748a8f755">back</a>( )<span class="keyword"> const</span></div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> *--<a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>( ); }</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#abc9f1f67bf23ed7ffc31361eaa14d0f6">  292</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#abc9f1f67bf23ed7ffc31361eaa14d0f6">push_front</a>( <span class="keyword">const</span> DT &amp; x )  </div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    { <a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>( <a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>( ), x ); }</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    </div>
<div class="line"><a name="l00297"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a9d82e154514bdc6379c83df36c86a63b">  297</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a9d82e154514bdc6379c83df36c86a63b">push_front</a>( DT &amp;&amp; x )</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;    { <a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>( <a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>( ), std::move( x ) ); }</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160; </div>
<div class="line"><a name="l00302"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">  302</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">push_back</a>( <span class="keyword">const</span> DT &amp; x )</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    { <a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>( <a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>( ), x ); }</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    </div>
<div class="line"><a name="l00307"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#ace9f92386dcd6f2308847ec05acfdcc4">  307</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#ace9f92386dcd6f2308847ec05acfdcc4">push_back</a>( DT &amp;&amp; x )</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    { <a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>( <a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>( ), std::move( x ) ); }</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160; </div>
<div class="line"><a name="l00311"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a8526d84e8c9d45422e591056d64dd013">  311</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a8526d84e8c9d45422e591056d64dd013">pop_front</a>( )</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    { <a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>( <a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>( ) ); }</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160; </div>
<div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a99f2784092ee14196c3b91de6836b93b">  315</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a99f2784092ee14196c3b91de6836b93b">pop_back</a>( )</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    { <a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>( --<a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>( ) ); }</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160; </div>
<div class="line"><a name="l00319"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a500d8b83580e3a67ef1118e6bef7635c">  319</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a500d8b83580e3a67ef1118e6bef7635c">printList</a>( ) </div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    {</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;        Node *p = head-&gt;next;</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;        <span class="keywordflow">while</span>( p-&gt;next != <span class="keyword">nullptr</span>)</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;        {</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;            std::cout &lt;&lt; p-&gt;data &lt;&lt; <span class="charliteral">&#39; &#39;</span> ;</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;            p = p-&gt;next;</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;        }</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        std::cout &lt;&lt; std::endl;</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    }</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160; </div>
<div class="line"><a name="l00334"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">  334</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>( <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr, <span class="keyword">const</span> DT &amp; x )</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    {</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        Node *p = itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;        theSize++;</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;        <span class="keywordflow">return</span> { p-&gt;prev = p-&gt;prev-&gt;next = <span class="keyword">new</span> Node{ x, p-&gt;prev, p } };</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    }</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160; </div>
<div class="line"><a name="l00345"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a3020daa2982b73be237e0b7735342d4c">  345</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a3020daa2982b73be237e0b7735342d4c">insert</a>( <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr, DT &amp;&amp; x )</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    {</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;        Node *p = itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;        theSize++;</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;        <span class="keywordflow">return</span> { p-&gt;prev = p-&gt;prev-&gt;next </div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;        = <span class="keyword">new</span> Node{ std::move( x ), p-&gt;prev, p } };</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;    }</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160; </div>
<div class="line"><a name="l00356"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">  356</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>( <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr )</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    {</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> q;</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="classDoubleLinkedList.html#a437f9858ac447a592d3075d30ef12649">canerase</a>(itr))</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;        {    </div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;            Node *p = itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> retVal{ p-&gt;next };</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;            p-&gt;prev-&gt;next = p-&gt;next;</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;            p-&gt;next-&gt;prev = p-&gt;prev;</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;            p-&gt;prev = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;            p-&gt;next = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;            <span class="keyword">delete</span> p;</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;            theSize--;</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;            <span class="keywordflow">return</span> retVal;</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;        }</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;        {</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;            std::cout &lt;&lt; <span class="stringliteral">&quot;Can&#39;t erase.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;            <span class="keywordflow">return</span> q;</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;        } </div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;    }</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160; </div>
<div class="line"><a name="l00382"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#acf8915685317c85b100b793123c14aba">  382</a></span>&#160;    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#acf8915685317c85b100b793123c14aba">erase</a>( <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> from, <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> to )</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    {</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr = from;</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> q;</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;        <span class="keywordflow">for</span>( itr = from; itr != to &amp;&amp; <a class="code" href="classDoubleLinkedList.html#a437f9858ac447a592d3075d30ef12649">canerase</a>(itr);)</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;        itr = <a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>( itr );</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;        <span class="keywordflow">if</span>(itr == to)</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;            <span class="keywordflow">return</span> to;</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;        {</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;            std::cout &lt;&lt;<span class="stringliteral">&quot;Can&#39;t erase.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;            <span class="keywordflow">return</span> q;</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;        }</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    }</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160; </div>
<div class="line"><a name="l00400"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a437f9858ac447a592d3075d30ef12649">  400</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classDoubleLinkedList.html#a437f9858ac447a592d3075d30ef12649">canerase</a> (<a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> &amp; itr)</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    {</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;        <span class="keywordflow">if</span>( itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a> &amp;&amp; </div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;            itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>-&gt;prev &amp;&amp; </div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;            itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>-&gt;next)</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;    }</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160; </div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160; </div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;    <span class="keywordtype">int</span> theSize;</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    Node *head;</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    Node *tail;</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160; </div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    <span class="keywordtype">void</span> init( )</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    {</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;        theSize = 0;</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;        head = <span class="keyword">new</span> Node;</div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;        tail = <span class="keyword">new</span> Node;</div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;        head-&gt;next = tail;</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;        tail-&gt;prev = head;</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;    }</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160; </div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;};</div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html">DoubleLinkedList::const_iterator</a></div><div class="ttdoc">const_iterator类，用于存储一个指向当前节点的迭代器，同时通过运算符重载实现所需的迭代器运算;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:37</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a112ee57553bfe22c9a26c21267bfd226"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a112ee57553bfe22c9a26c21267bfd226">DoubleLinkedList::const_iterator::const_iterator</a></div><div class="ttdeci">const_iterator()</div><div class="ttdoc">const_iterator 构造函数，使用初始化列表的方法，将current指针初始化为nullptr;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:41</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a2446ddd53bbc08c8b2fcc333db23ccb4"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a2446ddd53bbc08c8b2fcc333db23ccb4">DoubleLinkedList::const_iterator::operator!=</a></div><div class="ttdeci">bool operator!=(const const_iterator &amp;rhs) const</div><div class="ttdoc">重载！=号;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:93</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a32e0bd5fcc6b2379ab6ffceb154a3058"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a32e0bd5fcc6b2379ab6ffceb154a3058">DoubleLinkedList::const_iterator::const_iterator</a></div><div class="ttdeci">const_iterator(Node *p)</div><div class="ttdoc">const_iterator 构造函数，使用初始化列表的方法，将current指针初始化为p;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:107</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a3402baf1083aa613ca04732e7d783179"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a3402baf1083aa613ca04732e7d783179">DoubleLinkedList::const_iterator::operator*</a></div><div class="ttdeci">const DT &amp; operator*() const</div><div class="ttdoc">重载*号（取值）;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:45</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a4f6c7762f7932f1abcd6286b9c8360e1"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a4f6c7762f7932f1abcd6286b9c8360e1">DoubleLinkedList::const_iterator::operator++</a></div><div class="ttdeci">const_iterator &amp; operator++()</div><div class="ttdoc">重载++号（前置递增）将原来const_iterator类中的current指针所指的位置指向下一个位置;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:50</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a512b2d20b89afad27ab692e8ea1134d4"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a512b2d20b89afad27ab692e8ea1134d4">DoubleLinkedList::const_iterator::operator==</a></div><div class="ttdeci">bool operator==(const const_iterator &amp;rhs) const</div><div class="ttdoc">重载==号;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:87</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a746a66ff1facbbf98a43e86cd6d11724"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">DoubleLinkedList::const_iterator::current</a></div><div class="ttdeci">Node * current</div><div class="ttdoc">Node指针current,用来指示当前位置;.</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:98</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_ad93b067ec784301698d9890c721d3668"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#ad93b067ec784301698d9890c721d3668">DoubleLinkedList::const_iterator::operator--</a></div><div class="ttdeci">const_iterator &amp; operator--()</div><div class="ttdoc">重载–号（前置递减）将原来const_iterator类中的current指针所指的位置指向上一个位置;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:68</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_ae1db2e1e4c42600c184f6162157e4635"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">DoubleLinkedList::const_iterator::retrieve</a></div><div class="ttdeci">DT &amp; retrieve() const</div><div class="ttdoc">retrieve函数;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:102</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1iterator_html"><div class="ttname"><a href="classDoubleLinkedList_1_1iterator.html">DoubleLinkedList::iterator</a></div><div class="ttdoc">继承了const_iterator类，用于实现Node指针和const_iterator的转换</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:115</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1iterator_html_a18bcade792226cb8c59e90c5be0875f8"><div class="ttname"><a href="classDoubleLinkedList_1_1iterator.html#a18bcade792226cb8c59e90c5be0875f8">DoubleLinkedList::iterator::operator++</a></div><div class="ttdeci">iterator &amp; operator++()</div><div class="ttdoc">重载++号（前置递增）将原来iterator类中的this指针所指的位置指向下一个位置;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:132</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1iterator_html_a6e599dab684490c6339740d7a5cb8ae8"><div class="ttname"><a href="classDoubleLinkedList_1_1iterator.html#a6e599dab684490c6339740d7a5cb8ae8">DoubleLinkedList::iterator::operator--</a></div><div class="ttdeci">iterator &amp; operator--()</div><div class="ttdoc">重载–号（前置递减）将原来iterator类中的this指针所指的位置指向上一个位置;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:150</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1iterator_html_a9b2f090babb672b094aa4bd290238d80"><div class="ttname"><a href="classDoubleLinkedList_1_1iterator.html#a9b2f090babb672b094aa4bd290238d80">DoubleLinkedList::iterator::iterator</a></div><div class="ttdeci">iterator()</div><div class="ttdoc">iterator 构造函数，使用初始化列表的方法，初始化为空;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:118</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1iterator_html_ae6cb0eac7eeb7bc0fbd4b6dcf5616e50"><div class="ttname"><a href="classDoubleLinkedList_1_1iterator.html#ae6cb0eac7eeb7bc0fbd4b6dcf5616e50">DoubleLinkedList::iterator::operator*</a></div><div class="ttdeci">DT &amp; operator*()</div><div class="ttdoc">重载*号（取值），针对传入非const list的情况，调用了const_iterator类中的retrieve函数;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:122</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html"><div class="ttname"><a href="classDoubleLinkedList.html">DoubleLinkedList</a></div><div class="ttdoc">DoubleLinkedList的DT模板类</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:7</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a1a2a7c993e056a3d7e15bd1bf3d38bf2"><div class="ttname"><a href="classDoubleLinkedList.html#a1a2a7c993e056a3d7e15bd1bf3d38bf2">DoubleLinkedList::DoubleLinkedList</a></div><div class="ttdeci">DoubleLinkedList(DoubleLinkedList &amp;&amp;rhs)</div><div class="ttdoc">以DoubleLinkedList右值为参数的DoubleLinkedList构造函数;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:213</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a28c753ec25efce9713e58170bfa9812c"><div class="ttname"><a href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">DoubleLinkedList::push_back</a></div><div class="ttdeci">void push_back(const DT &amp;x)</div><div class="ttdoc">push_back函数，用于在链表结尾插入DT类型的数据x;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:302</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a3020daa2982b73be237e0b7735342d4c"><div class="ttname"><a href="classDoubleLinkedList.html#a3020daa2982b73be237e0b7735342d4c">DoubleLinkedList::insert</a></div><div class="ttdeci">iterator insert(iterator itr, DT &amp;&amp;x)</div><div class="ttdoc">insert函数的重载，用于在链表中插入新的节点;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:345</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a321d39c83c64c5a56491cfb6312c3112"><div class="ttname"><a href="classDoubleLinkedList.html#a321d39c83c64c5a56491cfb6312c3112">DoubleLinkedList::front</a></div><div class="ttdeci">DT &amp; front()</div><div class="ttdoc">front函数，用于返回链表开头位置的data值;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:272</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a437f9858ac447a592d3075d30ef12649"><div class="ttname"><a href="classDoubleLinkedList.html#a437f9858ac447a592d3075d30ef12649">DoubleLinkedList::canerase</a></div><div class="ttdeci">bool canerase(iterator &amp;itr)</div><div class="ttdoc">canerase函数用于判断是否可以对该迭代器进行erase操作;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:400</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a500d8b83580e3a67ef1118e6bef7635c"><div class="ttname"><a href="classDoubleLinkedList.html#a500d8b83580e3a67ef1118e6bef7635c">DoubleLinkedList::printList</a></div><div class="ttdeci">void printList()</div><div class="ttdoc">printList函数，用于在屏幕上打印当前链表的值;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:319</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a63980ca7417c2816904717c1cc4802cd"><div class="ttname"><a href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">DoubleLinkedList::erase</a></div><div class="ttdeci">iterator erase(iterator itr)</div><div class="ttdoc">erase函数，用于抹除链表中(头尾外)存在的节点;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:356</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a683ec24475d58d896c47b00d9893fb6d"><div class="ttname"><a href="classDoubleLinkedList.html#a683ec24475d58d896c47b00d9893fb6d">DoubleLinkedList::end</a></div><div class="ttdeci">const_iterator end() const</div><div class="ttdoc">end函数的重载，用于取得const链表的结尾;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:250</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a7203970b5e6ab0dadfdc039bc5714dca"><div class="ttname"><a href="classDoubleLinkedList.html#a7203970b5e6ab0dadfdc039bc5714dca">DoubleLinkedList::back</a></div><div class="ttdeci">DT &amp; back()</div><div class="ttdoc">back函数，用于返回end函数返回的迭代器所指向位置的前一位的data值;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:282</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a76384816354f94d8d42e0829c7bda914"><div class="ttname"><a href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">DoubleLinkedList::begin</a></div><div class="ttdeci">iterator begin()</div><div class="ttdoc">begin函数，用于取得链表的开头;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:235</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a781eabd9902464b05665ba9a5d547035"><div class="ttname"><a href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">DoubleLinkedList::insert</a></div><div class="ttdeci">iterator insert(iterator itr, const DT &amp;x)</div><div class="ttdoc">insert函数，用于在链表中插入新的节点;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:334</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a783cd5151e28aa5396fa7ea79f64835b"><div class="ttname"><a href="classDoubleLinkedList.html#a783cd5151e28aa5396fa7ea79f64835b">DoubleLinkedList::front</a></div><div class="ttdeci">const DT &amp; front() const</div><div class="ttdoc">front函数的重载，用于返回链表开头位置的data值;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:277</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a8526d84e8c9d45422e591056d64dd013"><div class="ttname"><a href="classDoubleLinkedList.html#a8526d84e8c9d45422e591056d64dd013">DoubleLinkedList::pop_front</a></div><div class="ttdeci">void pop_front()</div><div class="ttdoc">pop_front函数，用于除去链表的开头;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:311</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a857b3efd79c7794a99b82bbe65d4f2a9"><div class="ttname"><a href="classDoubleLinkedList.html#a857b3efd79c7794a99b82bbe65d4f2a9">DoubleLinkedList::operator=</a></div><div class="ttdeci">DoubleLinkedList &amp; operator=(const DoubleLinkedList &amp;rhs)</div><div class="ttdoc">重载=号（赋值），参数是左值DoubleLinkedList，通过调用std::swap函数完成;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:203</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a896b91eefaa6a0288e31a846382d1d39"><div class="ttname"><a href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">DoubleLinkedList::size</a></div><div class="ttdeci">int size() const</div><div class="ttdoc">size函数，用于取得链表的长度;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:255</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a8ebe0a7e9218900f723620eb5359df6c"><div class="ttname"><a href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">DoubleLinkedList::empty</a></div><div class="ttdeci">bool empty() const</div><div class="ttdoc">empty函数，用于判断链表是否被清空;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:260</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a941489c5c72cb46a00e24ff1c998b087"><div class="ttname"><a href="classDoubleLinkedList.html#a941489c5c72cb46a00e24ff1c998b087">DoubleLinkedList::~DoubleLinkedList</a></div><div class="ttdeci">~DoubleLinkedList()</div><div class="ttdoc">析构函数，释放内存，防止内存泄漏;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:193</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a99f2784092ee14196c3b91de6836b93b"><div class="ttname"><a href="classDoubleLinkedList.html#a99f2784092ee14196c3b91de6836b93b">DoubleLinkedList::pop_back</a></div><div class="ttdeci">void pop_back()</div><div class="ttdoc">pop_back函数，用于除去链表的结尾，同时防止segmentation fault;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:315</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a9d82e154514bdc6379c83df36c86a63b"><div class="ttname"><a href="classDoubleLinkedList.html#a9d82e154514bdc6379c83df36c86a63b">DoubleLinkedList::push_front</a></div><div class="ttdeci">void push_front(DT &amp;&amp;x)</div><div class="ttdoc">push_front函数的重载，用于在链表开头插入DT类型的右值数据x;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:297</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a9f6fd6fab778f30041aa6119b67d70db"><div class="ttname"><a href="classDoubleLinkedList.html#a9f6fd6fab778f30041aa6119b67d70db">DoubleLinkedList::DoubleLinkedList</a></div><div class="ttdeci">DoubleLinkedList(const DoubleLinkedList &amp;rhs)</div><div class="ttdoc">首先调用链表初始化函数以构造一个未传参数的DoubleLinkedList，然后将传入的DoubleLinkedList对象通过push_back函数加在链表末尾;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:184</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_aa52f0a0dea8b178abf3972cb5c7ba44b"><div class="ttname"><a href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">DoubleLinkedList::end</a></div><div class="ttdeci">iterator end()</div><div class="ttdoc">end函数，用于取得链表的结尾;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:245</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_abb15c59c5b15dbdecae44e186e7c9b2d"><div class="ttname"><a href="classDoubleLinkedList.html#abb15c59c5b15dbdecae44e186e7c9b2d">DoubleLinkedList::begin</a></div><div class="ttdeci">const_iterator begin() const</div><div class="ttdoc">begin函数的重载，用于取得const链表的开头;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:240</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_abc9f1f67bf23ed7ffc31361eaa14d0f6"><div class="ttname"><a href="classDoubleLinkedList.html#abc9f1f67bf23ed7ffc31361eaa14d0f6">DoubleLinkedList::push_front</a></div><div class="ttdeci">void push_front(const DT &amp;x)</div><div class="ttdoc">push_front函数，用于在链表开头插入DT类型的数据x;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:292</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_ace9f92386dcd6f2308847ec05acfdcc4"><div class="ttname"><a href="classDoubleLinkedList.html#ace9f92386dcd6f2308847ec05acfdcc4">DoubleLinkedList::push_back</a></div><div class="ttdeci">void push_back(DT &amp;&amp;x)</div><div class="ttdoc">push_back函数的重载，用于在链表结尾插入DT类型的右值数据x;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:307</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_acf8915685317c85b100b793123c14aba"><div class="ttname"><a href="classDoubleLinkedList.html#acf8915685317c85b100b793123c14aba">DoubleLinkedList::erase</a></div><div class="ttdeci">iterator erase(iterator from, iterator to)</div><div class="ttdoc">erase函数的重载，用于删除一段节点;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:382</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_ae137341cb837578aceed300d50ebe664"><div class="ttname"><a href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">DoubleLinkedList::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">clear函数，用于清空链表;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:264</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_ae4df7660c6cb44e3176de9e748a8f755"><div class="ttname"><a href="classDoubleLinkedList.html#ae4df7660c6cb44e3176de9e748a8f755">DoubleLinkedList::back</a></div><div class="ttdeci">const DT &amp; back() const</div><div class="ttdoc">back函数的重载，用于返回end函数返回的迭代器所指向位置的前一位的data值;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:287</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_aee88179cbec704a72abc4ffedaaae206"><div class="ttname"><a href="classDoubleLinkedList.html#aee88179cbec704a72abc4ffedaaae206">DoubleLinkedList::DoubleLinkedList</a></div><div class="ttdeci">DoubleLinkedList()</div><div class="ttdoc">调用链表初始化函数以构造一个未传参数的DoubleLinkedList;</div><div class="ttdef"><b>Definition:</b> doublelinkedlist.h:177</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
